<template>
    <view class="list-container">
        <view v-for="(item, index) in list" :key="index" class="list-item">{{ item }}</view>
    </view>
</template>

<script setup>
import { defineProps } from 'vue';

// 接收从父组件传入的列表数据
const props = defineProps({
    list: {
        type: Array,
        default: () => [],
    }
});
</script>

<style scoped>
.list-container {
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.list-item {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.list-item:last-child {
    border-bottom: none;
}
</style>
